package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCgImportMainMapper;
import com.ruoyi.system.domain.SysCgImportMain;
import com.ruoyi.system.service.ISysCgImportMainService;

/**
 * SysCgImportMainService业务层处理
 * 
 * @author SYF
 * @date 2025-05-08
 */
@Service
public class SysCgImportMainServiceImpl implements ISysCgImportMainService 
{
    @Autowired
    private SysCgImportMainMapper sysCgImportMainMapper;


    /**
     * 查询SysCgImportMain列表
     * 
     * @param sysCgImportMain SysCgImportMain
     * @return SysCgImportMain
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<SysCgImportMain> selectSysCgImportMainList(SysCgImportMain sysCgImportMain)
    {
        return sysCgImportMainMapper.selectSysCgImportMainList(sysCgImportMain);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<SysCgImportMain> selectSysCgImportMainUnLinkList(SysCgImportMain sysCgImportMain)
    {
        return sysCgImportMainMapper.selectSysCgImportMainUnLinkList(sysCgImportMain);
    }

    /**
     * 新增SysCgImportMain
     * 
     * @param sysCgImportMain SysCgImportMain
     * @return 结果
     */
    @Override
    public int insertSysCgImportMain(SysCgImportMain sysCgImportMain)
    {
        sysCgImportMain.setCreateTime(DateUtils.getNowDate());
        return sysCgImportMainMapper.insertSysCgImportMain(sysCgImportMain);
    }

    /**
     * 修改SysCgImportMain
     * 
     * @param sysCgImportMain SysCgImportMain
     * @return 结果
     */
    @Override
    public int updateSysCgImportMain(SysCgImportMain sysCgImportMain)
    {
        sysCgImportMain.setUpdateTime(DateUtils.getNowDate());
        return sysCgImportMainMapper.updateSysCgImportMain(sysCgImportMain);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectDepts(String year){
        return sysCgImportMainMapper.selectDepts(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectSales(String year){
        return sysCgImportMainMapper.selectSales(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectTypes(String year){
        return sysCgImportMainMapper.selectTypes(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<SysCgImportMain> selectCgImportMainList(SysCgImportMain sysCgImportMain){
        return sysCgImportMainMapper.selectCgImportMainList(sysCgImportMain);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectSpecs(String startDate,String endDate){
        return sysCgImportMainMapper.selectSpecs(startDate,endDate);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectCustomers(String startDate,String endDate){
        return sysCgImportMainMapper.selectCustomers(startDate,endDate);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectUnSupplyList(){
        return sysCgImportMainMapper.selectUnSupplyList();
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectResampleList(){
        return sysCgImportMainMapper.selectResampleList();
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectUnfulfilledList(String year){
        return sysCgImportMainMapper.selectUnfulfilledList(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectInventoryList(String year){
        return sysCgImportMainMapper.selectInventoryList(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectInventoryListNew(){
        return sysCgImportMainMapper.selectInventoryListNew();
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public Map<String,Object> selectLatestDate(){
        return sysCgImportMainMapper.selectLatestDate();
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectInventoryDetail(String year){
        return sysCgImportMainMapper.selectInventoryDetail(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> excuteQuery(String sql){
        return sysCgImportMainMapper.excuteQuery(sql);
    }
}
